//
//  AAViewController.m
//  iospro
//
//  Created by yons on 10.6.21.
//

#import "AAViewController.h"
#import "JXCategoryTitleView.h"
#import "BaseViewController.h"

@interface AAViewController ()
@property (nonatomic, strong) JXCategoryTitleView *myCategoryView;
@end

@implementation AAViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    
    self.myCategoryView.titles = self.titles;
    JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc ]init];
    self.myCategoryView.indicators = @[lineView];
    
}
- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];

    self.myCategoryView.frame = CGRectMake(0,88,self.view.bounds.size.width, 50);
}

- (CGFloat)preferredCategoryViewHeight {
    return 88 + 50;
}


- (JXCategoryTitleView *)myCategoryView {
    return (JXCategoryTitleView *)self.categoryView;
}

- (JXCategoryBaseView *)preferredCategoryView {
    return [[JXCategoryTitleView alloc] init];
}

// 返回各个列表菜单下的实例，该实例需要遵守并实现 <JXCategoryListContentViewDelegate> 协议
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
    BaseViewController *list = [[BaseViewController alloc] init];
    if (index == 0) {
        list.view.backgroundColor = [UIColor redColor];
    }else{
        list.view.backgroundColor = [UIColor yellowColor];
    }
    
    return list;
}

#pragma mark - JXCategoryListContentViewDelegate

- (UIView *)listView {
    return self.view;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
